<!--
 * @Descripttion:
 * @version:
 * @Author: caiailing
 * @Date: 2023-03-29 14:42:43
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-04-10 10:29:45
-->
<script lang="ts" setup>
import { useInit } from '@/hooks/useInit'
import { useTitle } from '@/hooks/useTitle'
import { onUrlPage } from '@/utils/router/router'
import uniAsync from '@/utils/uniAsync'

onLoad(() => {
  const { pageName, pagePath, pageQuery } = useInit()
  console.log(pageName, pagePath, pageQuery, 'pageName,pagePath, pageQuery')
})

const { title, changeTitle } = useTitle()

// const { name, fullName, updateName } = useStore('test')

async function uniAsyncTest() {
  const systemInfo = await uniAsync.getSystemInfo()
  console.log(systemInfo, 'systemInfo')
}

function onScrollToLower() {
  console.log('自定义 onScrollToLower')
}
</script>

<template>
  <div class="h-screen">
    <pullList :on-scroll-to-lower="onScrollToLower">
      <template #list>
        <!-- <view>name:{{ name }}</view>
        <view>fullName:{{ fullName }}</view>
        <view @click="updateName('newName')">updateName</view> -->
        <view>title:{{ title }}</view>
        <view @click="changeTitle">changeTitle</view>
        <view @click="uniAsyncTest">点击在控制台查看系统信息uniAsyncTest</view>
        <view data-url="index?a=1" @click="onUrlPage"
          >跳转首页并带参 onUrlPage</view
        >
        <view class="p-10 border h-md"> 测试unocss样式 unocss-test</view>
        <view v-for="i in 30" :key="i" class="p10">scroll Test</view>
      </template>
    </pullList>
  </div>
</template>

<style lang="scss" scoped></style>
